<gn-dialog title="用户信息" [customConfirm]="true" (onConfirm)="confirm()">
  <form gnForm url="/RESOURCES-SERVICE/users" [formGroup]="form.formGroup">
    <gn-form-field label="登录名" field="id" [visible]="!forEdit" [formGroup]="form.formGroup"
                   [validators]="[{message: '请输入', name: 'required', validatorFn: form.validators.required}]">
      <input matInput placeholder="请输入登录名" required="true" formControlName="id">
    </gn-form-field>
    <gn-form-field label="姓名" field="name" [formGroup]="form.formGroup"
                   [validators]="[{message: '请输入', name: 'required', validatorFn: form.validators.required}]">
      <input matInput placeholder="请输入姓名" required="true" formControlName="name">
    </gn-form-field>
    <gn-form-field label="密码" field="passwordValue" [visible]="!forEdit" [formGroup]="form.formGroup"
                   [validators]="[{message: '请输入', name: 'required', validatorFn: form.validators.required}]">
      <input matInput placeholder="请输入密码" required="true" type="password" formControlName="passwordValue">
    </gn-form-field>
    <gn-form-field label="确认密码" field="passwordConfirm" [visible]="!forEdit" [formGroup]="form.formGroup"
                   [validators]="[{message: '确认密码不匹配', name: 'equals', validatorFn: form.validators.equals(form.formGroup.controls['passwordValue'])}]">
      <input matInput placeholder="请输入确认密码" required="true" type="password" formControlName="type">
    </gn-form-field>
  </form>
</gn-dialog>
